﻿<Window x:Class="WpfVoronoiDllTest.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Voronoi PlayBoard" Height="500" Width="750">
    <Grid Margin="0" >
        <TabControl Margin="5"  >
            <TabItem Header="Seed Points">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="50" />
                        <RowDefinition Height="*" />
                        <RowDefinition Height="50" />
                    </Grid.RowDefinitions>
                    <StackPanel Grid.Row="0" Orientation="Horizontal">
                        <Button Content="Random"  Height="23" Margin="5" Name="button_seed" VerticalAlignment="Top"   Click="button_seed_Click"/>
                        <Button Content="Bricks"  Height="23" Margin="5" Name="button_brick" VerticalAlignment="Top"   Click="button_brick_Click"/>
                        <Button Content="HoneyComb"  Height="23" Margin="5" Name="button_honey_seed" VerticalAlignment="Top"   Click="button_honey_Click"/>
                        <Button Content="Circular"  Height="23" Margin="5" Name="button_circular_seed" VerticalAlignment="Top"   Click="button_circular_seed_Click"/>
                        <Button Content="Spiral"  Height="23" Margin="5" Name="button_spiral_seed" VerticalAlignment="Top"   Click="button_spiral_seed_Click"/>
                        <Button Content="Double Spiral "  Height="23" Margin="5" Name="button_spiral_double" VerticalAlignment="Top"   Click="button_spiral_double_Click"/>
                        <Button Content="Import"  Height="23" Margin="5" Name="button_import" VerticalAlignment="Top"  />
                        </StackPanel>
                    <ScrollViewer  HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Visible" Grid.Row="1" >
                        <Grid Name="SeedPanel" Grid.Column="0" Background="Black"  ClipToBounds="True"  MinHeight="500" MinWidth="1000" MouseDown="SeedPanel_MouseDown">

                            <ItemsControl  ItemsSource="{Binding}" Width="{Binding Width}" Height="{Binding Height}" Grid.RowSpan="2">
                                <ItemsControl.Resources>
                                    <Style TargetType="{x:Type ContentPresenter}" >
                                        <Setter Property="Canvas.Left" Value="{Binding X}" />
                                        <Setter Property="Canvas.Top" Value="{Binding Y}" />

                                    </Style>
                                </ItemsControl.Resources>
                                <ItemsControl.ItemTemplate>
                                    <DataTemplate>
                                        <Ellipse   Height="1.5" Width="1.5"  Stroke="Black" StrokeThickness="0" Fill="Yellow"   />
                                    </DataTemplate>
                                </ItemsControl.ItemTemplate>
                                <ItemsControl.ItemsPanel>
                                    <ItemsPanelTemplate>
                                        <Canvas />
                                    </ItemsPanelTemplate>
                                </ItemsControl.ItemsPanel>
                            </ItemsControl>
                        </Grid>
                    </ScrollViewer>
                    <StackPanel Grid.Row="2" Orientation="Horizontal">
                       <Button Content="Mirror H"  Height="23" Margin="5" Name="button_MirrorH" VerticalAlignment="Top" Click="button_MirrorH_Click" />
                        <Button Content="Mirror V"  Height="23" Margin="5" Name="button_MirrorV" VerticalAlignment="Top" Click="button_MirrorV_Click"/>
                        <Button Content="Mirror + Flip H"  Height="23" Margin="5" Name="button_MirrorFH" VerticalAlignment="Top" Click="button_MirrorFH_Click" />
                        <Button Content="Mirror + Flip V"  Height="23" Margin="5" Name="button_MirrorFV" VerticalAlignment="Top" Click="button_MirrorFV_Click" />
                        <Button Content="Clear Points"  Height="23"  Margin="5" Name="button_clear" VerticalAlignment="Top"   Click="button_clear_Click"/>
                    </StackPanel>
                </Grid>
            </TabItem>
            <TabItem Header="Voronoi Graph">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="50" />
                        <RowDefinition Height="*" />
                    </Grid.RowDefinitions>
                    <StackPanel Grid.Row="0" Orientation="Horizontal">                       
                        <Button Content="Draw Voronoi"  Height="23" Margin="5" Name="button_voronoi" VerticalAlignment="Top" Width="101"  Click="button_voronoi_Click"/>                      
                        <Button Content="Dealaunay Triangles"  Height="23"  Margin="5" Name="button_delaunay" VerticalAlignment="Top" Width="101"  Click="button_delaunay_Click"/>
                        <Button Content="Generate Poligons" Height="23"  Margin="5" Name="button_polygon" VerticalAlignment="Top" Width="101"  Click="button_polygon_Click"/>
                        <Button Content="Save to SVG" Height="23"  Margin="5" Name="button_export_svg" VerticalAlignment="Top" Width="101"  Click="button_export_svg_Click"/>
                        <Button Content="Save to SCR (Autocad Script)" Height="23"  Margin="5" Name="button_export_acd" VerticalAlignment="Top" Width="153"  Click="button_export_acd_Click"/>
                    </StackPanel>
                    <ScrollViewer  HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Visible" Grid.Row="1" >

                        <Canvas HorizontalAlignment="Stretch" Background="Aquamarine" Margin="0" Name="canvas1" VerticalAlignment="Stretch"  ClipToBounds="False" MinHeight="5000" MinWidth="10000"/>
                    </ScrollViewer>
                </Grid>
            </TabItem>
            <TabItem Header="Generated Files" >
                <StackPanel >
                    <TextBox Text="The SVG and SCR files, are saved in the program execution folder." />                    
                </StackPanel>
            </TabItem>
            <TabItem Header="Rounded Script">
                <StackPanel >
                    <TextBox Text="See FilletAll.lsp, is an autocad LISP script to round the poligon vertex." />
                </StackPanel>
            </TabItem>
        </TabControl>
        
        
            
       
      
    </Grid>
</Window>
